﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using Fms.Utilities.LanguageSupportDotNet;
using System.Windows.Forms;

namespace WindowsFormsApp1
{

    internal class Language
    {
        private LanguageSource _objFmsLangString;

        public void GetLanguage(string filePath, string languageID)
        {
            string text = Path.Combine(filePath, "BRLLICENG.LNG");
            string text2 = text;
            if (languageID != string.Empty)
            {
                text2 = Path.Combine(filePath, "BRLLIC" + languageID + ".LNG");
            }
            try
            {
                _objFmsLangString = new LanguageSource(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "BRLLIC  ", "BRLLIC", "ENG", languageID);
            }
            catch (Exception ex)
            {
                if (Environment.UserInteractive)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }

        public string GetLangString(int pointer)
        {
            if (_objFmsLangString == null)
            {
                return string.Empty;
            }
            return _objFmsLangString.GetLangString(pointer);
        }

        public string GetLangString(string value)
        {
            return value;
        }
    }

}
